<?php

/**
 * 合同小类仓库
 * @author wangwx 2015-5-12
 */
namespace common\repositories\myhtsq;
use common\repositories\BaseRepository;
use common\support\StringHelper;
use common\entities\myhtsq\ContractLittlerCategoryEntity;
class ContractLittlerCategoryRepository extends BaseRepository{

	/**
	 * 构造方法
	 * @param unknown $config (optional)
	 */
	public function __construct($config = [])
	{
		parent::__construct($config);
	}
	
	/**
	 * 根据合同大类id,获取合同小类
	 * @param string $bigClassId 合同大类id
	 * @return common\entities\myhtsq\ContractLittlerCategoryEntity
	 */
	public static function getAllContractLittlerCategoryByBigClassId($bigClassId) {
		return ContractLittlerCategoryEntity::find()->where(['big_category_id'=>$bigClassId])->all();
	}
	
	/**
	 * 根据合同小类id,获取小类名称
	 * @param string $littlerCategoryId
	 * @return string
	 */
	public static function getContractLittlerCategoryNameByLittlerCategoryId($littlerCategoryId){
		return ContractLittlerCategoryEntity::find()->select('littler_category_name')->where(['littler_category_id'=>$littlerCategoryId])->scalar();
	}
	
	
}